package com.neusoft.cebc.base.web;

import java.net.UnknownHostException;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.neusoft.cebc.base.entity.SysUser;
import com.neusoft.cebc.base.function.impl.UserServiceImpl;

@Controller
public class Login {
	@Autowired
	private UserServiceImpl UserService;
	
	@RequestMapping(value="/login.do")
	public String loginForm(String account,String password) throws UnknownHostException {
		String result = "shibai";
		System.out.println(account);
		try {
			SysUser user = UserService.login(account, password);
			if(user != null) {
				result = "index";
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		return result;
	}
	
}
